Macro FCInfo/cs

Macro FCInfo

Description
Gives information about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, percent), area, volume and weight in different units (metric and imperial). The macro now also works for the elements of a sketch in edit mode.


French Version Version Française

Macro version: 1.30c
Last modified: 2025/01/28
FreeCAD version: All
Download: ToolBar Icon
Author: Mario52

Author
Mario52
Download
ToolBar Icon
Links
Macro Version
1.30c
Date last modified
2025/01/28
FreeCAD Version(s)
All
Default shortcut
None
See also
Arch Survey, Macro SimpleProperties, Macro FCInfoGlass

Description

Popis

Dává řadu informací o vybraném tvaru a může zobrazit konverzi délky, sklonu (stupně, radiány, procenta) tělesa, povrchu, objemu a váhy tvaru s měrnou hmotností vybranou v různých jednotkách hmotnosti mezinárodních i Anglo-Saských.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro")
<class="rawcodeurl"><a href="https://gist.githubusercontent.com/mario52a/8d40ab6c018c2bde678f/raw/2ba412bef3a9a5a0c6da4f3be18513a585f3a301/FCInfo_en_Ver_1-30c-rmu_Docked.FCMacro">raw code</a>


FCInfo

Usage

Použití

Vyberete objekt nebo spustíte aplikaci a vyberete objekt a zobrazí se řada informací. Jeho výpočty založené na jednotce FreeCADu, což je mm pro kažbý nový výběr, vrací vždy délku v mm a úhel v dekadických stupních.

upper window
upper window
lower window

Sector 1: Document

  • Název dokumentu
  • Označení objektu
  • Interní název objektu
  • Název dílčího objektu
  • Typ objektu


Sector 1: Document

FCInfo Document

(you can checked to false the variable switch_setVisible_GBox_001_Document for hidden the Box)

Sector 2: Coordinates click mouse

  • Souřadnice X, Y a Z kliknutím myší
  • Tlačítko vytváří na bodové, osové, rovinné, kopírovací vektorové formě osy 'FreeCAD.Vector (-24.0, 240.0, 7.0)'

FCInfo Coordinate

(you can checked to false the variable switch_setVisible_GBox_002_Coordinate_Mouse for hidden the Box)

Sector 3: Color on point

FCInfo Color_on_point

Sector 3: Value

  • Délka objektu, je-li objekt obrys obličeje, zobrazí se velikost jednotky:
    km, hm, přehrada, m, dm, cm, 'mm' , μm, fm, palec, propojení, noha, yard, bidélko, řetěz, furlong, míle, ligy, námořní. Je-li objekt kružnicí o jednu sekundu, zobrazí se políčkoEdit a zobrazí poloměr kružnice.
  • Obvod tvaru

Sector 4: Components Mesh

FCInfo Component Mesh

If the selection is a mesh object one new window "Components" is displayed and gives:

(you can checked to false the variable switch_setVisible_GBox_004_Object_Mesh for hidden the Box)

Sector 5: Units

FCInfo Units

(you can checked to false the variable switch_setVisible_GBox_005_Value_Unit for hidden the Box)

Sector 6: Inclination

FCInfo Inclination

(you can checked to false the variable switch_setVisible_GBox_006_Inclination for hidden the Box)

Sector 7: Surface and Volume

FCInfo Surface and Volume

(you can checked to false the variable switch_setVisible_GBox_007_Surface_and_Volume for hidden the Box)

Sector 8: Cost

FCInfo Cost

0.027 Eu

10,0000 Eu (by Kg)
(you can checked to false the variable switch_setVisible_GBox_008_Cost_And_Price for hidden the Box)

Sector 9: BoundBox

FCInfo BoundBox

(you can checked to false the variable switch_setVisible_GBox_009_BoundBox for hidden the Box)

Sector 10: Center of:

FCInfo Center of...

(you can checked to false the variable switch_setVisible_GBox_010_Center_Mass for hidden the Box)

Sector 11: Inertia

FCInfo Inertia

same for length and weigth

(you can checked to false the variable switch_setVisible_GBox_011_Inertia for hidden the Box)

Sector 12: SpreadSheet

FCInfo Disabled

(you can checked to false the variable switch_setVisible_GBox_012_SpreadSheet for hidden the Box)

Sector 13: SpreadSheet creation

FCInfo SpreedSheet

Možnost uložit nebo přečíst tabulku s různým oddělovačem, tabulka, čárka, středník, prostor
Tabulace jsou oddělovač pro modul FreeCAD spreadSheet
Počet těchto čtyř oddělovačů se vypočítá pro pomoc, pokud není známo
COMMA jsou starý (01.16 a dřívější) oddělovač maker FCInfo
Nyní pro kompatibilitu s rozložením FreeCAD spreadSheet a od verze 01.17 je TABULACE implicitně oddělovač
Chcete-li převést vaši starou tabulku FCInfo: Otevřete ji ve složce FCInfo a uložte ji pomocí možnosti Tabulace

Sector 14: Main tools

FCInfo Main

(you can checked to false the variable switch_setVisible_GBox_014_Main_Tools for hidden the Box)

Po spuštění makra zůstane makro aktivní a okno zůstane viditelné. Chcete-li makro ukončit, stiskněte klávesu Exit. Pokud opustíte kříž, makro zůstane v paměti a data se objeví v zobrazení "sestavy" aplikace FreeCAD.

Options

Volby

Použité jednotky

Délková jednotka:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch(palec), link, foot(stopa), yard, perch, chain, furlong, mile, league, nautique.

Length unit:

km, hm, dam, m, dm, cm, mm, µm, nm, pm, fm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

Angle degrees :

Úhlové stupně :

  1. dekadické stupně, např: 174.831872611°
  2. stupně minuty vteřiny, např.: 174° 49' 54.741401''
  3. radiány, např.: 3.05139181449 rad
  4. grade, např.: 194.257636235 gon
  5. procenta např.: 30° = 57.74%

Understanding of angles in FCInfo display.

Weight unit :

Váhové jednotky :

ton, quintal, kg, hg, dag, gram, dg, cg, mg, µg, ng, pg, fg, gr (grain), dr (drachm), oz (once), oz t (once troy),
lb t (livre troy), lb (livre av), st (stone), qtr (quarter), cwt (hundredweight), tonneau fr, ct
"spinBox" je nastaven na 7,5 kg, tj. průměrná měrná hmotnost oceli. Chcete-li jinou defaultní (přednastavenou) hodnotu, změňte hodnotu měrné hmotnosti na řádku 208

FCInfo Configuration


This switch (section GroupBox) allows you to view only the desired section(s) (just visual) false or true.

All calculations are done without taking account of this option

Skript

Zkopírujte obsah tohoto makra do souboru nazvaného "FCInfo.FCMacro" (ve Windowsech) do "C:\Program Files\FreeCAD0.13".
Nebo přímo do okna FreeCADu
Ikona musí být ve stejném adresáři jako je makro pro Windows "C:\Program Files\FreeCAD0.13".
Stáhněte umístění obrázků u ikon a pravým tlačítkem je "Uložte jako" (neměňte jméno) (originál - Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name))

Copy the contents of the macro in a file named "FCInfo.FCMacro"

Or, directly in the interface of FreeCAD
The icon must be in the same directory as the macro.
Download image positioning on the icon and then drag the mouse right click "save as" (do not change the name)

PS: příliš dlouhá na to, aby byla obsažena na stránce wiki (zatím jsou stránky wiki pouze 64 KB) kód makra byl umístěn na fóru

Stáhněte soubor makra na podstavec ukotvený vpravo

(Nebo On the forum.)

PS: toto makro používá getSelection () a seznam objektů začíná na 1 ex: pro pole 'Edge1 to Edge12' a kód v konzole začíná na 0 ex: pro rámeček Edge [0] na Edge [11]
To je normální počítání na matici / seznamy uvnitř OpenCascade vždy začíná na 1 a ne na 0

Limitations

Omezení

Pro ukončení vždy používejte tlačítko Exit. Ukončení jiným způsobem zapříčiní, že program zůstane v paměti a běží a zobrazuje data v "reportovacím pohledu". Abyste uvolnili pamět, musíte ukončit celý FreeCAD.
V tabulce je viditelných pouze prvních 200 prvků objektu. Je-li jich v objektu více zobrazí se upozornění "'(! +200)" '. Kompletní seznam dat je viditelný v souboru uloženém pomocí tlačítka Save.

Pokud je makro okna po spuštění neviditelné, podívejte se do dolního okna:


projekt:
si přečtěte soubor přímo v tabulce. provedeno
odpovídá okraji a jejich souřadnic , které byly provedeny
Sdružení látky s její hustotou
sklon k prvku spíše než globální objekt proveden
vložte přímo do rozhraní FreeCADu do

Version

ver "1.30c" 2025/01/28 : replace connect comboBox for Arch Linux

replace:

QtCore.QObject.connect(self.comboBox_Unit, QtCore.SIGNAL(u"currentIndexChanged(QString)"), self.SIGNAL_comboPoids_Changed)

by:

self.comboBox_Unit.currentTextChanged.connect(self.SIGNAL_comboPoids_Changed)

ver "1.30b" 2025/01/20 : replace the slash Windows "\" by the slash Python "/"

ver "1.30" 2025/01/02 : delete all reference to PySide PySide2 and QtWidgets modify the (Qt) Save file

#
import PySide2
from PySide2 import QtGui , QtCore, QtWidgets
from PySide2.QtWidgets import QComboBox
from PySide2.QtWidgets import QMessageBox
from PySide2.QtWidgets import QTableWidget, QApplication
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *

            OpenName, Filter = PySide2.QtWidgets.QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide2

replaced and change command by

#
import PySide
try:
    from PySide import QtWidgets
    from PySide.QtWidgets import *
except Exception:
    None
from PySide import QtGui , QtCore
from PySide.QtGui import *
from PySide.QtCore import *

            OpenName, Filter = QFileDialog.getOpenFileName(None, u"Read a txt file", setPathLatestDirectory, "*.FCInfo *.csv *.asc *.txt;;FCInfo (*.FCInfo);;Cvs (*.csv);;Ascii (*.asc);;TXT (*.txt);;(*.*);;(*)")#PySide

ver "1.29b" 2024/05/10 PySide2 modify Inertia " MatrixX1*uniteM to (MatrixX1*uniteM) " and adding spinBox inertia

ver 1.29 2024/05/06 french version fr PySide6 by sylvainbx https://gist.github.com/sylvainbx/af09a30be3e1427de56305825331fb29 merci sylvainbx

ver 1.28b 1.28c 2023/10/30 orthographe

ver 1.28 01/09/2023 modify variable name, possibility hidden each sector, save data spreadSheet in document, surface radius, add button webWiki and webForum

ver 1.27 2023/06/30 optimize the styleSheet, correct the left/right position and restore view after edition sketcher

self.PB_00_Decrement.setStyleSheet("background-color: white; border:2px solid rgb(215, 10, 22);")      # bord white and red

replaced by

self.PB_00_Decrement.setStyleSheet("QPushButton {background-color: white; border:2px solid rgb(215, 10, 22)};")      # bord white and red
  • ver 1.22 , 12/11/2020 : now the macro is totally uninstalled i use :

Adding

FreeCAD.ActiveDocument.openTransaction(u"FCInfo")    # memorise les actions (avec annuler restore)
FreeCAD.ActiveDocument.commitTransaction()           # restore les actions  (avec annuler restore)
#FreeCAD.ActiveDocument.abortTransaction()            # abandonne les actions(avec annuler restore)
try:
        self.window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)    # destroy
        self.window.deleteLater()                                     # destroy
        self.window.destroy()                                         # destroy
except Exception:
        None

How do i exit from FreeCAD instead of Python?

instead:

self.window.hide()

and i adding the possibility display or not the "Error Message" window "False" by default, if you wand activate the warning window go to :

FreeCAD >Menu >Tools >Edit parameters... >BaseApp/Preferences/Macros/FCMmacros/FCInfo > switchWarning

currently:

  • ver 1.21-3.01 , 07/11/2019 # 07/11/2019 ver "01.21-3-rmu" replace character micro = "U", square = "2", cube = "3", degrees = " deg" see "https://forum.freecadweb.org/viewtopic.php?f=3&t=6005&start=70#p345819"
  • ver 1.21.01 (1.21-rmu) 30/05/2019 rmu change fixed positions to qt layouts grid.addWidget() by rmu75 see the rmu75 fork "https://gist.github.com/rmu75/b165147bd1c2f2659c014103793ae1d8"
  • ver 1.20 , 29/01/2018 optimization
  • ver 1.19 , 20/01/2018 create checkBox for use detection all elements of the object if wanted or not , the macro is faster. Optimisation
  • ver 1.18 , 19/12/2017 ...
  • ver 1.17c , 14/12/2017 create plane with coordinate give in one project in other project and replace "FCInfo" by "__title__"
  • ver 1.17b , 13/12/2017 little correction replace FCTreeView to FCInfo
  • ver 1.17 , 12/12/2017 add upgrade Moment of inertia mm and kg by pinq FCMacro and moment of inertia of assembly, and create plane, axis, point, and add options separator for spreadsheet
  • ver 1.16 , 21/06/2017 add control height police (here PointSize 8) and checkbox for position the window to right or left
  • ver 1.15 , 19/12/2015 suppression PyQt4 option see , add checkBox for editing infos in report view
  • ver 1.14 , 04/08/2014 replace PyQt4 and PySide and correct tooltip not displayed cause on PySide and add fg
  • ver 1.13 , 27/07/2014 replace FCInfo_en_Ver_1-12_Docked.FCMacro to FCInfo_en_Ver_1-13_Docked.FCMacro accept PyQt4 and PySide
  • ver 1.12 , 10/03/2014 adding tooltip
  • ver 1.11 , 04/03/2014 adding µm, nm, pm, fm, µg, ng, pg, pourcent, fixed of grandeur carat "cd" in "ct", display of the label and internal name, fixed calculation of angles XY YZ ZX could give an error on a compound shape, window dockable in FreeCAD
  • ver 1.10b , 19/11/2013 buttons outside the scrollbar and the dimensions of the window blocking
  • ver 1.10 , 18/11/2013 create scrollbar
  • ver 1.08b , 10/11/2013 translation units in English, error correction to display the area of the faces listed in the table and replacement of the"print" by "App.Console.PrintMessage"
  • ver 1.09 , 04/11/2013 works perfectly on Windows and Linux (cause of errors on Linux the characters : ² ³ ° "ordinal not in range(128)")
  • ver 1.08 , 24/10/2013 correction of high top "Faces" and "Edges" displaying 100 objects (in the saved file)
  • ver 1.07 , 11/10/2013 matches the "Faces" and their coordinates.
  • ver 1.06 , 22/09/2013 matches the "Edges" and their coordinates, inclination on the element rather than the global object
  • ver 1.05 , 17/09/2013 added an icon for the spreadsheet, conversion barrel fr, affichage des dimensions overall instead of coordinates.
  • ver 1.04 , 11/09/2013: read the file directly in a table.
  • ver 1.03 , 09/09/2013: clearer display in view report and replacement by "typeObject = sel[0].Shape.ShapeType"
  • ver 1.02 , 7/09/2013 : small updates
  • ver 1.00 , 6/09/2013

Odkazy

Viz také Arch Survey Arch Survey

See Also: Arch Survey Arch Survey

Své připomínky můžete sdílet na fóru Info Workbench - Help with icons please.
Zde je další příspěvek FCInfo Macro